'use strict';
const db = uniCloud.database() 
exports.main = async (event, context) => {
  //event为客户端上传的参数
	let type = event.type;
	if(type == 'init'){
		return await db.collection('admin').get()
	}else if(type == 'change'){
		return await db.collection('admin').doc(event._id).update({
			ok:event.check
		})
	}else if(type=='checkadmin'){
		return await db.collection('user').doc(event.id).get()
	}
 
};
